package androidApplication.javaFiles;

import ChatPackage.ChatHandler;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;

public class ChatAlert extends Activity {
	private String _senderId = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//setContentView(R.id.mapView);
		AlertDialog.Builder alt_bld = new AlertDialog.Builder(this);
		Bundle extras = getIntent().getExtras();
		if (extras!=null){
			_senderId = extras.getString("sender");
		}
		alt_bld.setMessage("you have a new messgae from "+ _senderId)
		.setCancelable(false)
		.setPositiveButton("Answer", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {
				ChatHandler.startUsersListActivity(getApplicationContext());
			}
		})
		
		.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {
				dialog.cancel();
			}
		});
		AlertDialog alert = alt_bld.create();
		// Title for AlertDialog
		alert.setTitle("New Message");
		// Icon for AlertDialog
		//alert.setIcon(R.drawable.icon);
		alert.show();
	}
}

